import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)

import Layout from '../layout/Layout.vue'


//配置项
const routes = [
  {
    path :'/login',
    component : () => import('@/views/login')
  },
  {
    path: '/',
    redirect: '/home'
  },
  {
    path: '/home',
    component: Layout,
    redirect: '/home/goods',
    children: [
      {
        path :'/home/goods',
        component:() => import('@/views/goods')
      },
      {
        path :'/home/comment',
        component:() => import('@/views/comment')
      },{
        path :'/home/shop',
        component:() => import('@/views/shop')
      }
    ]
  },
  {
    path :'/detail',
    component : () => import('@/views/detail')
  }
]

//创建实例
const router = new VueRouter({
  routes,
})

//导出实例
export default router

